	<h2>Annonces <a class="add-new-h2" href="<?php echo $CFG->config['base_url']?>product/admin/new_product">Ajouter</a></h2>


<ul class="subsubsub">
	<li class="all"><a class="current" href="<?php echo $CFG->config['base_url']?>product/admin">Tous <span class="count">(<?php echo $total?>)</span></a> |</li>
	<li class="publish"><a href="<?php echo $CFG->config['base_url']?>product/admin/index/status/publish">Activé <span class="count">(<?php echo $totalActive?>)</span></a></li>
</ul>
<form method="post" action="" id="posts-filter">

<p class="search-box">
  <input type="search" value="" name="s" id="post-search-input">
	<input type="submit" value="Chercher Annonce" class="button" id="search-submit" name="">
</p>
<div class="tablenav top">

		<div class="alignleft actions">
			<select name="action">
				<option selected="selected" value="0">Actions Groupées</option>
				<option class="hide-if-no-js" value="edit">Modifier</option>
				<option value="trash">Déplacer dans la Corbeille</option>
			</select>

		</div>
		<div class="alignleft actions">
			<select name="filter[date]">
				<option value="0" selected="selected">Toutes Dates</option>
				<?php 
				foreach($option_filter_date as $list){
					$s=$list->YearMonth==$filter['date']?' selected ' : '';
					echo "<option value='{$list->YearMonth}' $s>{$list->month} - {$list->year}</option>";
				}
				?>
			</select>
			<select class="postform" id="cat" name="filter[category]" onchange="if(this.value=!'')showOption(this.value)" >
				<option value="" >Categorie</option>
					<?php echo $option_filter_category?>
			</select>
			<input type="submit" value="Filtrer" class="button" id="post-query-submit">
		</div>

<div class="tablenav-pages ">
	<span class="displaying-num"><?php echo $totalActive?> annonces</span>
		<span class="pagination-links">
			<a href="#" title="Aller à la première page" class="first-page disabled" onclick="$('#current-page').val(1)">«</a>
			<a href="#" title="Aller à la page précédente" class="prev-page disabled" onclick="$('#current-page').val(parseInt($('#current-page').val())-1)">‹</a>
		<span class="paging-input">
			<input type="text" size="1" value="<?php echo $paged?>" name="paged" title="Page actuelle" id="current-page" class="current-page"> sur 
			<span class="total-pages" id="total-pages"><?php echo ceil($total/$limit)?></span>
		</span>
			<a href="#" title="Aller à la page suivante" class="next-page" onclick="$('#current-page').val(parseInt($('#current-page').val())+1)">›</a>
			<a href="#" title="Aller à la dernière page" class="last-page" onclick="$('#current-page').val($('#total-pages').text())">»</a>
		</span>
</div>
<script type="text/javascript">
function checkPaging(){
	if( parseInt($('#current-page').val())>1){
		$(".first-page").removeClass('disabled');
		$(".prev-page").removeClass('disabled');
	}else{
		$(".first-page").addClass('disabled');
		$(".prev-page").addClass('disabled');
	}
	
	if( parseInt($('#current-page').val())< parseInt($('#total-pages').text()) ){
		$(".next-page").removeClass('disabled');
		$(".last-page").removeClass('disabled');
	}else{
		$(".next-page").addClass('disabled');
		$(".last-page").addClass('disabled');
	}
	if(parseInt($('#current-page').val())<=1)$('#current-page').val(1);
	if( parseInt($('#current-page').val())> parseInt($('#total-pages').text()) )$('#current-page').val($('#total-pages').text());

}
$(".pagination-links a").click(function () {
		checkPaging();
		$('#posts-filter').submit();
});
$(document).ready(function() {
	checkPaging();
});
</script>

		<br class="clear">
	</div>
	<div id="pagePostOption">
		<div id="showOption">
		<?php echo $category_option?>
		</div>
	</div>
		
<script type="text/javascript">
	function showOption($value){
		$.post("<?php echo $CFG->config['base_url']?>setting/option/getFilters", {idOption:$value } ).
		done(function($data) {
		$('#pagePostOption').show('slow');
		$('#showOption').html($data);
		});
	} 
	function sort($nameCol,$this){
		$input=$this.next("input");
		$typeOfSort=$input.val();
		
		if($typeOfSort=='desc')$typeOfSort='asc';
		else $typeOfSort='desc';
		$input.attr('name','sort['+$nameCol+']');
		$input.val($typeOfSort);
		$('#posts-filter').submit();
	}
</script>
		
<table class="wp-list-table widefat fixed posts">
	<thead>
	<tr>
		<th  class="manage-column column-cb check-column annoncetout" id="annoncetout" scope="col">
			<label for="cb-select-all-1" class="screen-reader-text"> Tout</label>
			<input type="checkbox" id="cb-select-all-1"/>
		</th>
		<th  class="manage-column column-annoncephoto">Photos</th>
		<th  class="manage-column column-title sortable <?php echo $sort['prd_name']?>" scope="col">
			<a href="#" onclick="sort('prd_name',$(this))"><span>Titre & Texte</span><span class="sorting-indicator"></span></a>
			<input type="hidden" value="<?php echo $sort['prd_name']?>" name="sort[prd_name]" />
		</th>
		<th class="manage-column column-annoncecategories" scope="col">Categories</th>
		<th class="manage-column column-annonceinformation"  scope="col">Information</th>
		<th class="manage-column column-annonceprix" scope="col">Prix</th>
		<th class="manage-column column-annoncevalider" scope="col">V</th>
        <th class="manage-column column-annoncecreation" scope="col">Date Créa</th>
        <th class="manage-column column-annoncedepartement" scope="col">Dep.</th>
        <th class="manage-column column-annoncevue sortable <?php echo $sort['prd_counter']?>" scope="col">
			
			<a href="#" onclick="sort('prd_counter',$(this))">
				<span>Vues</span>
				<span class="sorting-indicator"></span>
			</a>
			<input type="hidden" value="<?php echo $sort['prd_counter']?>" name="sort[prd_counter]" />
		</th>
		<th class="manage-column column-annoncepropar" scope="col">Pro</span><span class="sorting-indicator"></span></a></th>
        <th class="manage-column column-annoncemontant"  scope="col">Montant</span><span class="sorting-indicator"></span></a></th>
       </tr>
	</thead>

	<tfoot>
	<tr>
		<th  class="manage-column column-cb check-column annoncetout" id="annoncetout" scope="col">
		<label for="cb-select-all-1" class="screen-reader-text"> Tout</label>
		<input type="checkbox" id="cb-select-all-1"/>
		</th>
		<th  class="manage-column column-annoncephoto">Photos</th>
		<th  class="manage-column column-title sortable <?php echo $sort['prd_name']?>" scope="col">
			<a href="#" onclick="sort('prd_name',$(this))"><span>Titre & Texte</span><span class="sorting-indicator"></span></a>
			<input type="hidden" value="<?php echo $sort['prd_name']?>" name="sort[prd_name]" />
		</th>
		<th class="manage-column column-annoncecategories" scope="col">Categories</th>
		<th class="manage-column column-annonceinformation"  scope="col">Information</th>
		<th class="manage-column column-annonceprix" scope="col">Prix</th>
		<th class="manage-column column-annoncevalider" scope="col">V</th>
        <th class="manage-column column-annoncecreation" scope="col">Date Créa</th>
        <th class="manage-column column-annoncedepartement" scope="col">Dep.</th>
        <th class="manage-column column-annoncevue sortable <?php echo $sort['prd_counter']?>" scope="col">
			
			<a href="#" onclick="sort('prd_counter',$(this))">
				<span>Vues</span>
				<span class="sorting-indicator"></span>
			</a>
			<input type="hidden" value="<?php echo $sort['prd_counter']?>" name="sort[prd_counter]" />
		</th>
		<th class="manage-column column-annoncepropar" scope="col">Pro</span><span class="sorting-indicator"></span></a></th>
        <th class="manage-column column-annoncemontant"  scope="col">Montant</span><span class="sorting-indicator"></span></a></th>
	</tr>
	</tfoot>

	<tbody id="the-list">
	<?php 
	if(!empty($listAllProducts))
		foreach ($listAllProducts as $product){

	?>
		<tr valign="top" class="post type-post status-publish format-image hentry" id="post-<?php echo $product->prd_id?>">
			<th class="manage-column column-cb check-column annoncetout" scope="row">
				<label for="cb-select-14" class="screen-reader-text">Selectionner produit</label>
				<input type="checkbox" value="<?php echo $product->prd_id?>" name="post[]" id="cb-select-<?php echo $product->prd_id?>">
			</th>
			<td class="photo column-annoncephoto"><img height="50" src="<?php echo $CFG->config['base_url']?>images/thumbnails/<?php echo $product->link_photo?>"/></td>
			<td class="post-title page-title column-annoncetitle">
				<strong>
				<a title="Modifier <?php echo $product->prd_name?>" href="<?php echo $CFG->config['base_url']?>product/admin/edit/<?php echo $product->prd_id?>" class="row-title"><?php echo $product->prd_name?></a><br />
				</strong>
				<div id="lignes" class="lignes">
                	<?php echo substr_replace(strip_tags($product->prd_description),'',55,-1)?>...
                </div>
				<div class="row-actions">
					<span class="edit"><a title="Modifier Produit" href="<?php echo $CFG->config['base_url']?>product/admin/edit/<?php echo $product->prd_id?>">Modifier</a> | </span>
					<?php $activeProduct=$product->prd_active?'deactive':'reactive';
					$activeProductShow=$product->prd_active?'Déactiver':'reactiver';
					?>
					<span class="trash"><a href="<?php echo $CFG->config['base_url']?>product/admin/<?php echo $activeProduct.'/'.$product->prd_id?>" title="placer dans le corbeille" class="submitdelete"><?php echo $activeProductShow?></a> | </span>
					<span class="view"><a rel="permalink" title="Voir <?php echo $product->prd_name?>" href="<?php echo $CFG->config['base_url'].$product->link_cat_product."/".$product->prd_link.".html"?>">Apperçu</a></span>
				</div>
			</td>
			<td class="categories column-annoncecategories">
				<div class="categorie"><?php echo $product->category_name?></div>
          	</td>
			<td class="column-annonceinformation">
				<div id="nom" class="nom">
					<strong title="Nom et Prénom"> <?php echo $product->user_name?></strong>
				</div>
				<div id="telephone" class="telephone">
					<strong title="Téléphone" class="<?php echo $product->user_tel_show?'strike':''?>"> <?php echo $product->user_tel?></strong>
				</div>
				<div id="email" class="email">
					<strong title="email"> <?php echo $product->user_email?></strong>
				</div>                
            </td>
			<td class="column-annonceprix">
            	<div id="texteprix" class="texteprix"><?php echo $product->prd_price?><?php echo $CFG->config['admin_currency']?></div>
          	</td>
		  	<td class="column-annoncevaliderpng">
		  		<?php echo $product->prd_active?
					' <div class="valideroui"> </div>':
		  			' <div class="validernon"> </div>'.
		  			'<a tilte="Envoyer un Email de confirmation" href="'.$CFG->config['base_url'].'product/admin/send/'. $product->prd_id.'">Ok</a>'
		  		;?>
		  		
            </td>
			<td class="date column-date column-annoncecreation" scope="col">
	            <div title="creation" class="creation"><?php echo date($CFG->config['date_format'],$product->date_create)?></div>
	            <div title="expiration" class="expiration"><?php echo date($CFG->config['date_format'],$product->date_validate)?></div>
	            <div title="date fin de priorité" class="priority"><?php echo $product->priority_date ? date($CFG->config['date_format'],$product->priority_date):''?></div>
	            <br/>
	        </td>
			<td class="column-annoncecomments">
	             <div id="cp" class="cp" title="<?php echo $product->ville?>"><?php echo $product->prd_codepostal?></div>
	        </td>
            <td class="manage-column column-date sortable annonceasc"><?php echo $product->prd_counter?></td>
			<td class="column-annoncedate">
			<?php echo ($product->shop_id)? "<a href='{$CFG->config['base_url']}shop/admin/edit/$product->shop_id'>Pro</a>":""?>
	            <?php echo $product->company?
					' <div class="iconparticulier"> </div>':
		  			' <div class="iconprofessionnel"> </div>';?>
            </td>
          <td class="sortable asc column-annoncemontant"><?php echo $product->prd_paid?></td>
		</tr>
		<?php }?>
	</tbody>
</table>
	<div class="tablenav bottom">

		<div class="alignleft actions">
			<select name="action2">
<option selected="selected" value="-1">Trier en vrac</option>
	<option class="hide-if-no-js" value="edit">Editer</option>
	<option value="trash">Mettre à la corbeille</option>
</select>
<input type="submit" value="Appliquer" class="button action" id="doaction2" name="">
		</div>
		<div class="alignleft actions">
		</div>
<div class="tablenav-pages one-page"><span class="displaying-num">2 items</span>
<span class="pagination-links"><a href="http://localhost/wordpress/wp-admin/edit.php" title="Go to the first page" class="first-page disabled"> « </a>
<a href="http://localhost/wordpress/wp-admin/edit.php?paged=1" title="Go to the previous page" class="prev-page disabled">â€¹</a>
<span class="paging-input">1 of <span class="total-pages">1</span></span>
<a href="http://localhost/wordpress/wp-admin/edit.php?paged=1" title="Go to the next page" class="next-page disabled"> < </a>
<a href="http://localhost/wordpress/wp-admin/edit.php?paged=1" title="Go to the last page" class="last-page disabled">»</a></span></div>
		<br class="clear">
	</div>

</form>


<div id="ajax-response"></div>
<br class="clear"/>
</div>



<div class="clear"></div>